package com.vlatacom;

import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.channel.PollableChannel;
import org.springframework.integration.core.Message;
import org.springframework.integration.core.MessageChannel;
import org.springframework.integration.message.MessageBuilder;

public class App {

	public static void main( String[] args ) {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring-context.xml");
		context.start();
		
		MessageChannel input = context.getBean("input", MessageChannel.class);
		PollableChannel output = 
                (PollableChannel) context.getBean("output", PollableChannel.class ); 
        input.send(MessageBuilder.withPayload("Pro Spring Integration Example").build()); 
        Message<?> reply = output.receive(); 
        System.out.println("received: " + reply);
    }
}
